package com.bkgy.modular.rawMaterialRules.controller;

import com.alibaba.fastjson.JSONObject;
import com.bkgy.modular.rawMaterialRules.service.AcidRollingStockExamineService;
import com.bkgy.modular.rawMaterialRules.service.AcidRollingStockService;
import com.bkgy.modular.rawMaterialRules.service.CalthresholdService;
import com.bkgy.modular.rawMaterialRules.service.LThightService;
import com.bkgy.sys.common.entity.ResultData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ZhuHongKai
 * @version 1.0
 * @ClassName ContinuousWithdrawalController
 * @date 2023/1/4 14:32
 */
@RestController
@RequestMapping("/Rulebase")
public class RulebaseController {

    @Resource
    private CalthresholdService calthresholdService;

    @Resource
    private AcidRollingStockService acidRollingStockService;

    @Resource
    private AcidRollingStockExamineService acidRollingStockExamineService;

    @Resource
    private LThightService lThightService;

    /**
     * 2130酸轧成品连退原料阈值数据查询接口
     * @return
     */
    @PostMapping("/findCalthresholdData")
    public ResultData findCalthresholdData() {
        return calthresholdService.findCalthresholdData();
    }

    /**
     * 2130酸轧成品连退原料阈值更新数据
     * @param jsonObject
     * @return
     */
    @PostMapping("/updateCalthresholdData")
    public ResultData updateCalthresholdData(@RequestBody JSONObject jsonObject) {
        return calthresholdService.updateCalthresholdData(jsonObject);
    }

    /**
     * 酸轧原料审核硅钢阈值配置查询
     * @return
     */
    @PostMapping("/findAcidRollingStockData")
    public ResultData findAcidRollingStockData() {
        return acidRollingStockService.findAcidRollingStockData();
    }

    /**
     * 酸轧原料审核硅钢阈值配置更新数据
     * @param jsonObject
     * @return
     */
    @PostMapping("/updateAcidRollingStockData")
    public ResultData updateAcidRollingStockData(@RequestBody JSONObject jsonObject) {
        return acidRollingStockService.updateAcidRollingStockData(jsonObject);
    }

    /**
     * 酸轧原料审核阈值配置数据查询
     * @return
     */
    @PostMapping("/findAcidRollingStockExamineData")
    public ResultData findAcidRollingStockExamineData() {
        return acidRollingStockExamineService.findAcidRollingStockExamineData();
    }

    /**
     * 酸轧原料审核阈值配置数据更新
     * @param jsonObject
     * @return
     */
    @PostMapping("/updateAcidRollingStockExamineData")
    public ResultData updateAcidRollingStockExamineData(@RequestBody JSONObject jsonObject) {
        return acidRollingStockExamineService.updateAcidRollingStockExamineData(jsonObject);
    }

    /**
     * 2130酸轧成品连退原料厚度阈值数据查询
     * @return
     */
    @PostMapping("/findLThightData")
    public ResultData findLThightData() {
        return lThightService.findLThightData();
    }

    /**
     * 2130酸轧成品连退原料厚度阈值数据更新
     * @param jsonObject
     * @return
     */
    @PostMapping("/updateLThightData")
    public ResultData updateLThightData(@RequestBody JSONObject jsonObject) {
        return lThightService.updateLThightData(jsonObject);
    }
}
